//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yls.except.util.json;

import com.le.xxl.JsonTool;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class JHH extends JFrame implements ActionListener {
    JTextArea jta = new JTextArea();
    JScrollPane jsp;
    JButton chengButton;

    public JHH() {
        this.jsp = new JScrollPane(this.jta);
        this.chengButton = new JButton("validate");
        this.setTitle("JSON格式化工具");
        this.add(this.jsp, "Center");
        this.add(this.chengButton, "South");
        this.setBounds(20, 20, 800, 600);
        this.setVisible(true);
        this.setDefaultCloseOperation(3);
        this.chengButton.addActionListener(this);
    }

    public void actionPerformed(ActionEvent e) {
        if(e.getSource() == this.chengButton) {
            String temps = this.jta.getText();
            temps = JsonTool.ascii2Native(temps);
            temps = JsonTool.formatJson(temps, "        ");
            this.jta.setText(temps);
        }
    }

    public static void main(String[] args) {
        new JHH();
    }
}
